<%@page import="dto.MemberDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript">
function getDateForDisplay(){
	var date = ${sessionScope.login_info.regist_date};
	date = date.toString(10);
	var dateText = document.createTextNode((date.substring(0,4)+"."+date.substring(4,6)+"."+date.substring(6,8)));
	var td1 = document.getElementById("date");
	td1.appendChild(dateText);
};
function updateMember(){
	document.location.href="member_update.do";
};
</script>
<body onload="getDateForDisplay()">
	<table>
		<tr>
		<td valign="top">
		<table border="1">
			<tr>
				<td>
					<c:choose>
						<c:when test="${sessionScope.login_info.picture_filename != null}">
							<img src="/${initParam.context_root }/member_picture/${sessionScope.login_info.picture_filename}" width="100" ><br>
						</c:when>
						<c:otherwise>
							<img src="/${initParam.context_root }/member_picture/default.PNG" width="100" ><br>
						</c:otherwise>
					</c:choose>
				</td>
			</tr>
			<tr>
				<td width="100">id : ${sessionScope.login_info.member_id}</td>
			</tr>
			
		</table>
		</td>
		
		<td valign="top">
		<table border="1">
			<tr>
				<td width="200" height="20" >name : ${sessionScope.login_info.first_name} ${sessionScope.login_info.last_name}</td>
			</tr>
			<tr>
				<td width="200" height="20">birthday : ${sessionScope.login_info.birthday}</td>	
			</tr>
			<tr>
				<td width="200" height="20">phone number : ${sessionScope.login_info.phone_no}</td>
			</tr>
			<tr>
				<td width="200" height="20">address : ${sessionScope.login_info.address}</td>
			</tr>
			<tr>
				<td width="200" height="20" id="date">가입일자 : </td>
			</tr>
		</table>
		</td>
		</tr>
		<tr>
		<td><button onclick="updateMember()">수정</button>	</td>
		</tr>
	</table>
</body>
</html>